Linux swiotlb now uses correct method for determining if any RAM
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 21 Nov 2005 15:10:19 +0000 (16:10 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 21 Nov 2005 15:10:19 +0000 (16:10 +0100)
is mapped above 2GB.

Signed-off-by: Keir Fraser <keir@xensource.com>
Config.mk
linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c

index 3b24b07abed93de1bf27491b31b4665dbb3326b5..645457376a8d38c936f48fbae8d5685d7379fe0f 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -3,7 +3,7 @@
 # Currently supported architectures: x86_32, x86_64
 XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
 XEN_TARGET_ARCH     ?= $(XEN_COMPILE_ARCH)
-XEN_TARGET_X86_PAE  ?= n
+XEN_TARGET_X86_PAE  ?= y
 
 # Tools to run on system hosting the build
 HOSTCC     = gcc
index e2a14d1688181ac8f70313a8824896f597a18281..7a50607f05929ee28b3e6d9d69d1e459a01f1040 100644 (file)
@@ -24,6 +24,7 @@
 #include <asm/io.h>
 #include <asm/pci.h>
 #include <asm/dma.h>
+#include <asm-xen/xen-public/memory.h>
 
 #define OFFSET(val,align) ((unsigned long)((val) & ( (align) - 1)))
 
@@ -186,10 +187,10 @@ swiotlb_init(void)
          * which we take to mean more than 2GB.
          */
        if (xen_start_info->flags & SIF_INITDOMAIN) {
-               dom0_op_t op;
-               op.cmd = DOM0_PHYSINFO;
-               if ((HYPERVISOR_dom0_op(&op) == 0) &&
-                   (op.u.physinfo.total_pages > 0x7ffff))
+               unsigned long ram_end;
+               if (HYPERVISOR_memory_op(XENMEM_maximum_ram_page, &ram_end))
+                       BUG();
+               if (ram_end > 0x7ffff)
                        swiotlb = 1;
        }